require(tidyverse)
require(knitr)
require(dplyr)
require(ggplot2)
# from github devtools::install_github('marcusvolz/mathart') require(mathart)
# devtools::install_github('cutterkom/generativeart') require(generativeart)
require(aRtsy)
require(gganimate)
load GSSG data
f1 <- "https://raw.githubusercontent.com/slcornett/creative-data-visualization/main/data/2018-04-05_GSSG_Oxidation.csv"
gssg <- read_csv(f1, col_names = TRUE)
## Rows: 321761 Columns: 2
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (2): time_s, GSSG_Current_µA
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
gssg <- gssg %>%
filter(time_s >= 1000, time_s <= 2000) # make it slightly less giant
# statics plot
gssg_p1 <- ggplot(data = gssg, aes(x = time_s, y = GSSG_Current_µA, color = GSSG_Current_µA)) + scale_color_continuous(type = "viridis") +
geom_jitter() + theme_classic() + labs(title = "GSSG and Glycine", x = "time (s)", y = "Current (µA)")
gssg_p1
# animated!!
gssg_a1 <- ggplot(data = gssg, aes(x = time_s, y = GSSG_Current_µA, color = GSSG_Current_µA)) + scale_color_continuous(type = "viridis") +
geom_jitter() + theme_classic() + labs(title = "GSSG and Glycine: {frame_time}", x = "time (s)",
y = "Current (µA)") + transition_time(time = gssg$time_s) + shadow_wake(wake_length = 0.1, alpha = FALSE) +
shadow_mark(alpha = 0.3, size = 0.5) + ease_aes("linear")
gssg_a1